package com.chen.common;

import com.sun.javafx.font.PrismFontStrike;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * ClassName: PageParam
 * Package: com.chen.common
 * Description:
 *
 * @Author 陈俊辉
 * @Create 2024/4/11 18:19
 * @Version 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "分页请求参数")
public class PageParam {
    public static final Integer PAGE_NO=1;
    public static final Integer PAGE_SIZE=10;

    @Schema(name = "pageNo",description = "分页的页码",example = "1")
    @NotNull(message = "分页的页码不能为空")
    @Min(value = 0,message = "最小值不能小于1")
    private Integer page=PAGE_NO;

    @Schema(name = "pageSize",description = "分页的数量",example = "10")
    @NotNull(message = "分页的页数不能为空")
    @Min(value = 1,message = "页数不能小于1")
    @Max(value = 100,message = "页数不能大于100")
    private Integer pageSize=PAGE_SIZE;





}
